<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>handler_ptr::invoke</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter&#160;1.&#160;Boost.Beast">
<link rel="up" href="../boost__beast__handler_ptr.html" title="handler_ptr">
<link rel="prev" href="has_value.html" title="handler_ptr::has_value">
<link rel="next" href="operator_star_.html" title="handler_ptr::operator*">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="has_value.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__beast__handler_ptr.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="operator_star_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="beast.ref.boost__beast__handler_ptr.invoke"></a><a class="link" href="invoke.html" title="handler_ptr::invoke">handler_ptr::invoke</a>
</h5></div></div></div>
<p>
          <a class="indexterm" name="idp103571712"></a>
Invoke the handler in the owned object.
        </p>
<h6>
<a name="beast.ref.boost__beast__handler_ptr.invoke.h0"></a>
          <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.invoke.synopsis"></a></span><a class="link" href="invoke.html#beast.ref.boost__beast__handler_ptr.invoke.synopsis">Synopsis</a>
        </h6>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
    <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">&gt;</span>
<span class="keyword">void</span>
<span class="identifier">invoke</span><span class="special">(</span>
    <span class="identifier">Args</span><span class="special">&amp;&amp;...</span> <span class="identifier">args</span><span class="special">);</span>
</pre>
<h6>
<a name="beast.ref.boost__beast__handler_ptr.invoke.h1"></a>
          <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.invoke.description"></a></span><a class="link" href="invoke.html#beast.ref.boost__beast__handler_ptr.invoke.description">Description</a>
        </h6>
<p>
          This function invokes the handler in the owned object with a forwarded
          argument list. Before the invocation, the owned object is destroyed, satisfying
          the deallocation-before-invocation Asio guarantee.
        </p>
<h6>
<a name="beast.ref.boost__beast__handler_ptr.invoke.h2"></a>
          <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.invoke.preconditions"></a></span><a class="link" href="invoke.html#beast.ref.boost__beast__handler_ptr.invoke.preconditions">Preconditions:</a>
        </h6>
<p>
          <code class="computeroutput"><span class="identifier">has_value</span><span class="special">()</span>
          <span class="special">==</span> <span class="keyword">true</span></code>
        </p>
<h6>
<a name="beast.ref.boost__beast__handler_ptr.invoke.h3"></a>
          <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.invoke.postconditions"></a></span><a class="link" href="invoke.html#beast.ref.boost__beast__handler_ptr.invoke.postconditions">Postconditions:</a>
        </h6>
<p>
          <code class="computeroutput"><span class="identifier">has_value</span><span class="special">()</span>
          <span class="special">==</span> <span class="keyword">false</span></code>
        </p>
<h6>
<a name="beast.ref.boost__beast__handler_ptr.invoke.h4"></a>
          <span class="phrase"><a name="beast.ref.boost__beast__handler_ptr.invoke.remarks"></a></span><a class="link" href="invoke.html#beast.ref.boost__beast__handler_ptr.invoke.remarks">Remarks</a>
        </h6>
<p>
          Care must be taken when the arguments are themselves stored in the owned
          object. Such arguments must first be moved to the stack or elsewhere, and
          then passed, or else undefined behavior will result.
        </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2016, 2017 Vinnie Falco<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="has_value.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__beast__handler_ptr.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="operator_star_.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
